<%@ page language="java" import="java.util.*,com.hs.core.cache.*" pageEncoding="utf-8"%>
<%
   String pageStr = (String)request.getAttribute("pagestr");
   List datalist = (List)request.getAttribute("datalist");
   	String pagenum = (String)request.getAttribute("pagenum");
	String pagecount = (String)request.getAttribute("pagecount");
	
	int pagenumInt = Integer.parseInt(pagenum);
	int pagecountInt = Integer.parseInt(pagecount);
   String orderName = (String)request.getAttribute("orderName");
   String orderNum = (String)request.getAttribute("orderNum"); 
   String statinfo = (String)request.getAttribute("statinfo");
   
   String allsql = (String)request.getAttribute("allsql");
   String onesql = (String)request.getAttribute("onesql");
   String secondType = (String)request.getAttribute("secondType");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html >
<head>
<%@ include file="../../include.jsp"%> 
 <script src="<%=basePath %>app/javascripts/transform.js"></script>
<script language=JavaScript>
var stype = <%=secondType%>;
if(stype !=null && stype !="" && stype!="0")
{
	var sbutton = window.parent.document.getElementById("secondsearch");
	sbutton.disabled=false;
}
 //题录信息
 function magaInfo(id)
{
	var pageURL = "<%=basePath %>data/magainfo.do?id=" + id;
	openwindow(pageURL,'800','600',''); 
}
//详细数据信息
 function auditInfo(id){
	var pageURL = "<%=basePath %>audit/auditlistFrame.do?id=" + id;
	openwindow(pageURL,'1000','800',''); 
    //window.location.href=pageURL;
 }
 //排序
  function orderPageLocal(cstr,orderNum){
      
 	  var conobj = window.parent.document.all.conditionurl; 
	  if(conobj !=null && typeof(conobj) !=undefined){
		  	var convalue = conobj.value;
		  	if(convalue.indexOf("?")!=-1 ){
		  		convalue +="&orderName="+cstr+"&orderNum="+orderNum;
		  	}else {
		  		convalue +="?orderName="+cstr+"&orderNum="+orderNum; 
		  	}
		  	window.parent.document.getElementById("bookframe").src = convalue;
	  } 
 }
 function exportResult(){
 	var checkObj =  document.all.checkmaga;
 	var magaid = "";
 	for(var i=0 ;i<checkObj.length; i++){
 		if(checkObj[i].checked){
 			magaid = magaid + checkObj[i].value + ",";
 		}
 	} 
 	if(magaid != ""){
 		var allsql = document.all.allsql.value;
 		document.exportform.action="<%=basePath%>search/exportMagaResult.do?magaid="+magaid+"&allsql="+ encodeURIComponent(allsql)+"&resulttype=1";	
  		document.exportform.submit();
 	}else{
 		alert("请选择要导出的数据!");
 	}
 }
 
  function exportAllResult(){
 	var allsql = document.all.allsql.value;
 	document.exportform.action="<%=basePath%>search/exportMagaResult.do?allsql="+ encodeURIComponent(allsql)+"&resulttype=2";	
  	document.exportform.submit();
 }
</script>
</head>
<body>
<div class="cont">
    <%if(null != statinfo && !"".equals(statinfo)){ %>
    <div class="sear">
    	<table width="100%" border="0" cellspacing="0" cellpadding="0" class="deta_list_sear"> 
    		<tr>
    			<td width="75%" align=left><font color=red size=3><%=statinfo==null?"":statinfo%></font></td>
    			<td align=right><input   type="button" onclick="exportResult();" value="导出数据" class="butt4"/></td>
    			<td align=right><input   type="button" onclick="exportAllResult();" value="导出全部" class="butt4"/></td>
    		</tr>
    	</table>
   </div>
   <%} %>
   <div class="deta_sear_list">
        <dl>
    <form name="exportform" action="<%=basePath %>search/exportMagaResult.do" method=post>
        <table border="0" cellspacing="0" cellpadding="0" class="list1">
         <input type="hidden"  value="<%=allsql ==null?"":allsql%>" name="allsql"/> 
         <input type="hidden"  value="<%=onesql ==null?"":onesql%>" name="onesql"/> 
         <input type="hidden"  value="<%=secondType ==null?"0":secondType%>" name="searchtype"/> 
      <tr>
      	<th width="3%">选择</th>
        <th width="3%">序号</th>  
        <th width="19%"><a href="javaScript:orderPageLocal('a.maganame','<%=OrderTool.getOrderNum("a.maganame",orderName,orderNum)%>');">标题&nbsp;&nbsp;<%=OrderTool.getOrderImage(basePath,OrderTool.getOrderNum("a.maganame",orderName,orderNum))%></a></th>
        <th width="15%"><a href="javaScript:orderPageLocal('a.periodicalname','<%=OrderTool.getOrderNum("a.periodicalname",orderName,orderNum)%>');">出版物&nbsp;&nbsp;<%=OrderTool.getOrderImage(basePath,OrderTool.getOrderNum("a.periodicalname",orderName,orderNum))%></a></th>
        <th width="15%">作者</th>
        <th width="10%" nowrap>第一作者单位</th> 
        <th width="10%"><a href="javaScript:orderPageLocal('a.year','<%=OrderTool.getOrderNum("a.year",orderName,orderNum)%>');">出版日期&nbsp;&nbsp;<%=OrderTool.getOrderImage(basePath,OrderTool.getOrderNum("a.year",orderName,orderNum))%></a></th>
        <th width="10%">中医疾病</th>
        <th width="10%">西医疾病</th>
        <th width="5%">下载</th>  
      </tr>
      
      <% if(null != datalist && datalist.size()>0){
      		for(int i =0;i<datalist.size();i++){
      			Map dm = (Map)datalist.get(i);
       %>
      <tr>
     	 <td align="center"><input type="checkbox" name="checkmaga" id="checkmaga" value="<%=dm.get("ID")%>"/></td> 
        <td align="center"><%=(pagecountInt*(pagenumInt-1))+i+1 %></td> 
        <td><a href="javaScript:magaInfo('<%=dm.get("ID")%>');"><%=dm.get("MAGANAME") %></a></td> 
        <td><%=StringUtilTool.NULL2Blank(dm.get("PERIODICALNAME")+"") %></td>
        <td><%=StringUtilTool.NULL2Blank(dm.get("AUTHOR")+"")%></td>
        <td><%=StringUtilTool.NULL2Blank(dm.get("AUTHORUNIT")+"")%></td>  
        <td><%=StringUtilTool.NULL2Blank(dm.get("YEAR")+"")%></td>  
        <td><a href="javaScript:auditInfo('<%=dm.get("ID") %>')"><%=StringUtilTool.NULL2Blank(dm.get("DISEASENAME")+"") %></a></td>
        <td><a href="javaScript:auditInfo('<%=dm.get("ID") %>')"><%=StringUtilTool.NULL2Blank(dm.get("DISEASENAMEN")+"")%></a></td>
        <td><a href="javaScript:openwindow('<%=basePath %>search/filelist.do?id=<%=dm.get("ID")%>','500','300','')">下载</a></td>  
       </tr>
      
      <%}%>
      </form>
         <tr>
         <td colspan=9>
         <%=pageStr %> </td>
         </tr>
      
      <%}else{ %>
      <tr>
        <td align="center" colspan="10"><font color="red" size=3>没有符合查询条件的结果</font></td>
      </tr>
      <%}%>
    </table>  
    
    </dl>
       
   </div>
</div>
</body>
</html>

